package main

import "fmt"

/**
	go指针不能运算
	go参数是值传递还是引用传递？
	go语言只有值传递
 */

func main()  {
	//var a int = 2
	//var pa *int = &a
	//*pa = 3
	//fmt.Println(a)
	//b := 4
	//c := 5
	//swap(&b,&c)
	//fmt.Print(b, c)
	//c, b  = swap1(b, c)
	//fmt.Print(c,b)
	//声明指针
	var aa *int
	aa = new(int)
	*aa = 19
	fmt.Println(aa)

}

//变量交换
//指针类型
func swap(a,b *int) {
	*a, *b = *b, *a
}

//常用类型
func swap1(a,b int) (int,int) {
	return b,a
}